package com.primb.bench.common.module.http.service;


import com.primb.bench.project.approval.entity.ApprovalListEntity;
import com.primb.bench.project.approval.entity.ApprovalNextEntity;
import com.primb.bench.project.home.entity.ApplyNextUserEntity;
import com.primb.bench.project.home.entity.HttpApplyResultEntity;
import com.primb.bench.project.home.entity.HttpCheckProEntity;
import com.primb.bench.project.home.entity.HttpClientEntity;
import com.primb.bench.project.home.entity.HttpEnsureMoneyEntity;
import com.primb.bench.project.home.entity.HttpEnsureObjectEntity;
import com.primb.bench.project.home.entity.HttpLoanTreeEntity;
import com.primb.bench.project.home.entity.HttpInfoEntity;
import com.primb.bench.project.home.entity.HttpLogoEntity;
import com.primb.bench.project.home.entity.HttpProInfo;
import com.primb.bench.project.home.entity.HttpPromiseEntity;
import com.primb.bench.project.home.entity.HttpResultEntity;
import com.primb.bench.project.home.entity.HttpStockEntity;
import com.primb.bench.project.home.entity.HttpStrEntity;
import com.primb.bench.project.home.entity.PromiseListEntity;
import com.primb.bench.project.init.entity.LoginEntity;
import com.primb.bench.project.search.entity.HttpSearchInfoEntity;
import com.primb.bench.project.search.entity.ProcessEntity;
import com.primb.bench.project.search.entity.PriceListEntity;
import com.primb.bench.project.search.entity.ReapplyListEntity;

import java.util.Map;

import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by Chen on 2017/4/25.
 * 功能描述：
 */

public interface ApiService {
    /**
     * 登录接口
     *
     * @param userId   账号
     * @param password 密码
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_usrCheck.action")
    Observable<LoginEntity> getLoginInfo(@Field("userId") String userId, @Field("password") String password);

    /**
     * 退出登录接口
     */
    @POST("mobilePhoneAction_doLogout.action")
    Observable<HttpStrEntity> exitLogin();

    /**
     * 贷款测算定价信息接口
     *
     * @return
     */
    @POST("mobilePhoneAction_doLoanCustInitPara.action")
    Observable<HttpLogoEntity> getLoanLogoInfo();

    /**
     * 贷款测算客户查询列表接口
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListCustInfo.action")
    Observable<HttpClientEntity> getLoanClientList(@FieldMap Map<String, String> map);

    /**
     * 贷款测算币种列表接口
     *
     * @return
     */
    @POST("mobilePhoneAction_doListCurrency.action")
    Observable<HttpInfoEntity> getLoanCurrencyList();

    /**
     * 贷款测算列表信息接口
     * //主担保方式;//客户规模;//客户信用;//客户类型;//利率类型
     *
     * @param codeTypeId
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListMabusiCode.action")
    Observable<HttpInfoEntity> getLoanInfoList(@Field("codeTypeId") String codeTypeId);


    /**
     * 删除担保物接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doFillLnAssInfo3.action")
    Observable<HttpStrEntity> deleteAllEnsureObject(@Field("priceId") String priceId);

    /**
     * 贷款投向行业列表接口
     *
     * @return
     */
    @POST("mobilePhoneAction_doListlnIndu.action")
    Observable<HttpInfoEntity> getLoanIndustryList();

    /**
     * 贷款业务品种列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListPrdtTree.action")
    Observable<HttpLoanTreeEntity> getLoanBusinessList(@Field("custType") String custType);

    /**
     * 贷款机构列表接口
     *
     * @return
     */
    @POST("mobilePhoneAction_doListOrgTree2.action")
    Observable<HttpLoanTreeEntity> getLoanPartList();

    /**
     * 贷款担保物类型列表接口
     *
     * @return
     */
//    @FormUrlEncoded
//    @POST("mobilePhoneAction_doListCollaType.action")
//    Observable<HttpInfoEntity> getEnsureConcretenessList(@Field("codeType") String codeType);

    /**
     * 贷款担保抵质押物保存接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doSaveorUpdatePawn.action")
    Observable<HttpStrEntity> saveEnsureObject(@FieldMap Map<String, String> map);

    /**
     * 贷款担保抵质押物列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListlnAssInfo.action")
    Observable<HttpEnsureObjectEntity> getEnsureObjectList(@FieldMap Map<String, String> map);

    /**
     * 贷款担保金额汇总接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doFillLnAssInfo.action")
    Observable<HttpEnsureMoneyEntity> saveObjectList(@Field("priceId") String priceId);

    /**
     * 贷款担保金额汇总接口
     *
     * @return
     */
//    @FormUrlEncoded
//    @POST("mobilePhoneAction_doFillLnAssInfo2.action")
//    Observable<HttpEnsureMoneyEntity> saveObjectListr(@Field("priceId") String priceId);

    /**
     * 贷款担保物删除接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doDelLnAss.action")
    Observable<HttpStrEntity> deleteEnsureObject(@Field("guatantId") String guatantId);

    /**
     * 贷款具体担保方式列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListLnAssTree.action")
    Observable<HttpLoanTreeEntity> getLoanConcretenessList(@Field("LnAssType") String codeTypeId);

    /**
     * 贷款测算接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doLoanCustPriceCal.action")
    Observable<HttpResultEntity> getLoanCalculateResult(@FieldMap Map<String, String> map);

    /**
     * 贷款承诺情况接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doCheckFinishPromise.action")
    Observable<HttpCheckProEntity> checkPromise(@Field("custId") String custId);

    /**
     * 贷款测算保存接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doPriceSave.action")
    Observable<HttpStrEntity> saveLoanCalculateResult(@FieldMap Map<String, String> map);

    /**
     * 承诺调节列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListSceneInfo.action")
    Observable<PromiseListEntity> getPromiseList(@FieldMap Map<String, String> map);


    /**
     * 承诺优惠利率测算接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doSceneirText.action")
    Observable<HttpPromiseEntity> getCalculateGoodRate(@FieldMap Map<String, String> map);

    /**
     * 承诺优惠利率删除接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doCancelScene.action")
    Observable<HttpStrEntity> deletePromiseInfo(@Field("priceId") String priceId);

    /**
     * 承诺优惠信息接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doShowSceneParam.action")
    Observable<HttpProInfo> getPromiseInfo(@Field("custId") String custId);


    /**
     * 利率申请接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doFindApprover.action")
    Observable<ApplyNextUserEntity> getCalculateApplyRate(@FieldMap Map<String, String> map);


    /**
     * 利率申请接口(无流程)
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doSavePriceDetail.action")
    Observable<HttpStrEntity> getApplyRateNoProcess(@FieldMap Map<String, String> map);

    /**
     * 利率申请下一审批人信息提交接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doSaveStatusInfo.action")
    Observable<HttpApplyResultEntity> submitNextPerson(@FieldMap Map<String, String> map);


    /**
     * 续作定价接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doQueryRecpInfo.action")
    Observable<HttpStockEntity> stockCalculateLoan(@Field("agmId") String agmId);


    /**
     * 贷款定价结果列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doSearhLnpFor.action")
    Observable<PriceListEntity> getSearchPriceList(@FieldMap Map<String, String> map);

    /**
     * 贷款定价结果/退回申请详情接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doCustPriceDetail.action")
    Observable<HttpSearchInfoEntity> getSearchPriceInfo(@Field("priceId") String priceId);

    /**
     * 贷款定价结果详情接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListAllApprovalUserInfo.action")
    Observable<ProcessEntity> getSearchProcessInfo(@Field("priceId") String priceId);

    /**
     * 贷款退回申请列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doListAllApprovalPrice.action")
    Observable<ReapplyListEntity> getSearchReapplyList(@FieldMap Map<String, String> map);

    /**
     * 审批待办列表接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doLoanPricingApprovalView.action")
    Observable<ApprovalListEntity> getApprovalList(@FieldMap Map<String, String> map);

    /**
     * 利率重新申请接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doApplyAgain.action")
    Observable<HttpApplyResultEntity> reapplyRate(@FieldMap Map<String, String> map);

    /**
     * 利率重新申请下一审批人信息提交接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_findNextApprover.action")
    Observable<ApplyNextUserEntity> submitReapplyNextPerson(@FieldMap Map<String, String> map);

    /**
     * 待办审批下一审批人信息提交接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_findNextApprover.action")
    Observable<ApprovalNextEntity> findNextApproval(@Field("goOrBack") String goOrBack, @Field("priceId") String priceId);


    /**
     * 待办审批同意意见提交接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("mobilePhoneAction_doApprovalLnpPrice.action")
    Observable<HttpStrEntity> commitAdvice(@FieldMap Map<String, String> map);
}
